<!DOCTYPE html>
<html xmlns:wb="http://open.weibo.com/wb">
<head table_border=RmgvMj >
    <meta charset="UTF-8">
    <title>{$seoinfo['seotitle']}-{$GLOBALS['cfg_webname']}</title>
    {if $seoinfo['keyword']}
    <meta name="keywords" content="{$seoinfo['keyword']}"/>
    {/if}
    {if $seoinfo['description']}
    <meta name="description" content="{$seoinfo['description']}"/>
    {/if}
    {include "pub/varname"}
    {Common::css('base.css,extend.css,jquery.fancybox.css,scan_code.css')}
    {Common::js('jquery.min.js,base.js,common.js,delayLoading.min.js,jquery.fancybox.js,layer/layer.js',false)}
    <!-- 头部底部 -->
    {Common::css_plugin('spot_detail.css','spot')}
    {Common::js_plugin('swiper/swiper2.min.js,laypage/laypage.js','spot',false)}
    {Common::css_plugin('../js/swiper/swiper2.css,../js/font/iconfont.css,../js/laypage/skin/laypage.css','spot',false)}
    <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=A92LToAU0LvNAypkocsoGz8YSp9Aelku"></script>
</head>
<body>
{request "pub/header"}
<div class="fl100">
    <!-- 面包屑导航 -->
    <div class="subnav">
        <div class="wm-1200">
            {loop $crumbs $crumb_key $crumb}
            {if !empty($crumb['href'])}
            <a href="{$crumb['href']}">{$crumb['name']}</a>
            <span class="symbol">></span>
            {else}
            <span class="present">{$crumb['name']}</span>
            {/if}
            {/loop}
        </div>
    </div>

    <!-- 产品信息 -->
    <div class="ticket-info">
        <div class="wm-1200 clearfix">
            <div class="ticket-info-left">
                <div class="pc-slide">
                    <div class="view">
                        <div class="swiper-container">
                            <div class="number">产品编号：{$info['series']}</div>
                            <div class="swiper-wrapper">
                                {loop $info['piclist'] $pic_key $pic}
                                <div class="swiper-slide"><img src="{Common::img($pic[0],550,293)}" alt=""></div>
                                {/loop}
                            </div>
                        </div>
                    </div>
                    <div class="preview">
                        <a class="arrow-left" href="javascript:;"><span class="ticket-icon"></span></a>
                        <a class="arrow-right" href="javascript:;"><span class="ticket-icon"></span></a>
                        <div class="swiper-container">
                            <div class="swiper-wrapper">
                                {loop $info['piclist'] $pic_key $pic}
                                <div class="swiper-slide">
                                    <div class="img-div"><img src="{Common::img($pic[0],120,64)}" alt=""></div>
                                </div>
                                {/loop}
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 分享 -->
                <div class="share-bar-box clearfix">
                    <div class="code-item">
                        <wb:share-button addition="full" type="button"></wb:share-button>
                        <script src="https://tjs.sjs.sinajs.cn/open/api/js/wb.js" type="text/javascript" charset="utf-8"></script>
                    </div>
                    <div class="code-item">
                        <a href="javascript:;" class="name"><i class="icon"></i>二维码分享</a>
                        {php}
                        $url = Common::get_web_url($info['webid']).'/spots/show_'.$info['aid'].'.html';
                        {/php}
                        <div class="con-box"><img src="/res/vendor/qrcode/make.php?param={$url}" alt=""></div>
                    </div>
                </div>
            </div>
            <div class="ticket-info-right">
                <div class="price">
                    {if !empty($info['price'])}
                    <span class="f">{Currency_Tool::symbol()}</span><span class="n">{$info['price']}</span><span class="q">起</span>
                    {else}
                    <span class="n">电询</span>
                    {/if}
                </div>
                <h1 class="show-title">{$info['title']}</h1>
                <div class="info-item clearfix">
                    <span class="label">景点地址：</span>
                    <div class="text">
                        <span class="t">{$info['address']}</span>
                        {if !empty($info['lng']) && !empty($info['lat'])}
                        <a class="maps" data-href="md-jtdt" href="javascript:;"><span class="ticket-icon"></span>地图</a>
                        {/if}
                    </div>
                </div>
                <div class="info-item clearfix">
                    <span class="label">开放时间：</span>
                    <div class="text">{$info['open_time_des']}</div>
                </div>
                <div class="info-item clearfix">
                    <span class="label">积分促销：</span>
                    <div class="text">{implode('、',$info['jifen_des_arr'])}</div>
                </div>

                {if St_Functions::is_normal_app_install('coupon') && ($coupon=Model_Coupon::get_mobile_coupon_info($typeid,$info['id'])) && $coupon['totalnum']>0 }
                <div class="info-item clearfix">
                    <span class="label">优惠券：</span>
                    <div class="text clearfix">
                        {loop $coupon['price'] $coupon_price}
                        <p class="yhq">{$coupon_price}优惠券</p>
                        {/loop}
                        <a class="more" href="{$cmsurl}coupon-5-{$info['id']}">更多&gt;</a>
                    </div>
                </div>
                {/if}
                <div class="intro">
                    <div class="text">{$info['sellpoint']}</div>
                    <div class="unfold">{$info['sellpoint']}</div>
                </div>
                <div class="sfrm clearfix">
                    {if ($GLOBALS['cfg_satisfy']==1)}
                    <p class="satisficing"><span class="n">{str_replace('%','',$info['satisfyscore'])}</span>% 满意</p>
                    {/if}
                    <a class="remark" data-href="md-sppl" href="javascript:;">查看<span class="n">{$info['commentnum']}</span>条点评</a>
                </div>
                {if St_Functions::is_normal_app_install('supplier_shop') && $info['supplierlist'] && Model_Supplier::display_is_open()}
                {php $shop_url=Model_Supplier_Shop::get_pc_shop_link($info['supplierlist'],1,false); }
                {if !empty($shop_url)}
                <div class="supplier">
                    <span class="ticket-icon"></span>供应商：
                    <a class="gys" href="{Model_Supplier_Shop::get_pc_shop_link($info['supplierlist'],1,false)}">{$info['suppliername']}</a>
                </div>
                {else}
                <div class="supplier">
                    <span class="ticket-icon"></span>供应商：
                    <a class="gys" href="javascript:;">{$info['suppliername']}</a>
                </div>
                {/if}
                {/if}
            </div>
        </div>
    </div>

    <!-- 内容菜单 -->
    <div class="mainnav">
        <div class="mainnav-fixed">
            <div class="prev btn op5"><span></span></div>
            <div class="next btn"><span></span></div>
            <div class="goreserve"><a class="reserve-btn" href="javascript:;" data-href="md-mpyd">立即预订</a></div>
            <div class="wm-1200">
                <div class="con clearfix">
                    {if $info['hasticket']}
                    <a class="on" href="javascript:;" data-href="md-mpyd">门票预订</a>
                    {/if}
                    {if !empty($info['lng']) && !empty($info['lat'])}
                    <a href="javascript:;" data-href="md-jtdt">交通地图</a>
                    {/if}
                    {st:detailcontent action="get_content" pc="1" typeid="$typeid" productinfo="$info"
                    return="spotcontent"}
                    {loop $spotcontent $row}
                    <a href="javascript:;" data-href="md-{$row['columnname']}">{$row['chinesename']}</a>
                    {/loop}
                    {/st}
                    <a href="javascript:;" data-href="md-sppl">商品评论</a>
                    <a href="javascript:;" data-href="md-wyzx">我要咨询</a>
                </div>
            </div>
        </div>
    </div>

    <!-- 产品详情 -->
    <div class="detail-main">
        <div class="wm-1200 clearfix">
            <!-- 菜单对应内容区 -->
            <!-- 产品预定 -->
            <div class="content-main-reserve" id="md-mpyd">
                <table class="table">
                    <thead>
                    <tr>
                        <th colspan="2">产品</th>
                        <th>提前预定时间</th>
                        <th>取消政策</th>
                        <th>原价</th>
                        <th>优惠价</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    {st:spot action="suit_type" row="8" productid="$info['id']" return="typelist"}
                    {loop $typelist $type}
                    {st:spot action="suit_by_type" row="10" productid="$info['id']" suittypeid="$type['id']"
                    return="suitlist"}
                    {if !empty($suitlist)}
                    <tr>
                        <td rowspan="{count($suitlist)}" class="va-top" id="sub_{$type['id']}">{$type['title']}</td>
                        <td>
                            <a class="reserve-name" name="sub_{$type['id']}" href="javascript:;">
                                <span class="text">{$suitlist[0]['title']}</span><span class="ticket-icon"></span>
                            </a>
                        </td>
                        <td>
                            <div class="c-666">{if
                                !empty($suitlist[0]['day_before_des'])}{$suitlist[0]['day_before_des']}{else}当天24:00前{/if}
                            </div>
                        </td>
                        <td>
                            <div class="c-666">
                                {if $suitlist[0]['refund_restriction']==0}无条件退
                                {elseif $suitlist[0]['refund_restriction']==1}不可退改
                                {elseif $suitlist[0]['refund_restriction']==2}有条件退
                                {/if}
                            </div>
                        </td>
                        <td>
                            <p class="c-c4c4c4">{if !empty($suitlist[0]['sellprice'])}{Currency_Tool::symbol()}{$suitlist[0]['sellprice']}{/if}</p>
                        </td>
                        <td>
                            <div class="price">
                                {if !empty($suitlist[0]['ourprice'])}
                                {Currency_Tool::symbol()}<span class="n">{$suitlist[0]['ourprice']}</span>
                                {else}
                                <span class="n">电询</span>
                                {/if}
                            </div>
                        </td>
                        <td>
                            {if $suitlist[0]['price_status']==1}
                            {if !empty($suitlist[0]['ourprice'])}
                            <a class="reserve-btn" href="javascript:;" data-suitid="{$suitlist[0]['id']}">立即预订</a>
                            {else}
                            <a class="reserve-btn disabled" href="javascript:;">售罄</a>
                            {/if}
                            {elseif $suitlist[0]['price_status']==3}
                            <a class="reserve-btn disabled" href="javascript:;">售罄</a>
                            {elseif $suitlist[0]['price_status']==2}
                            <a class="reserve-btn disabled" href="javascript:;">售罄</a>
                            {/if}
                        </td>
                    </tr>
                    <tr class="unfold">
                        <td colspan="6">
                            <div class="detail-con">
                                <h3 class="title">{$suitlist[0]['title']}</h3>
                                <ul>
                                    <li class="clearfix">
                                        <span class="label">有效期限：</span>
                                        {if $suitlist[0]['effective_days']==0 }
                                        <div class="con">指定日期当天内有效</div>
                                        {else}
                                        <div class="con">游客指定入园日期{$suitlist[0]['effective_days']}天内有效</div>
                                        {/if}
                                    </li>
                                    <li class="clearfix">
                                        <span class="label">取票方式：</span>
                                        <div class="con">{$suitlist[0]['get_ticket_way']}</div>
                                    </li>
                                    <li class="clearfix">
                                        <span class="label">退改方式：</span>
                                        <div class="con">
                                            {if $suitlist[0]['refund_restriction']==0}无条件退
                                            {elseif $suitlist[0]['refund_restriction']==1}不可退改
                                            {elseif $suitlist[0]['refund_restriction']==2}有条件退
                                            {/if}
                                        </div>
                                    </li>
                                    {if !empty($suitlist[0]['suppliername'])}
                                    <li class="clearfix">
                                        <span class="label">供应商：</span>
                                        <div class="con">{$suitlist[0]['suppliername']}</div>
                                    </li>
                                    {/if}
                                    <li class="clearfix">
                                        <span class="label">门票说明：</span>
                                        <div class="con">
                                            {$suitlist[0]['description']}
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                    {loop $suitlist $suit_key $suit}
                    {if $suit_key>0}
                    <tr>
                        <td>
                            <a class="reserve-name" name="sub_{$type['id']}" href="javascript:;">
                                <span class="text">{$suit['title']}</span>
                                <span class="ticket-icon"></span>
                            </a>
                        </td>
                        <td>
                            <div class="c-666">
                                {if !empty($suit['day_before_des'])}{$suit['day_before_des']}{else}当天24:00前{/if}
                            </div>
                        </td>
                        <td>
                            <div class="c-666">
                                {if $suit['refund_restriction']==0}无条件退
                                {elseif $suit['refund_restriction']==1}不可退改
                                {elseif $suit['refund_restriction']==2}有条件退
                                {/if}
                            </div>
                        </td>
                        <td>
                            <p class="c-c4c4c4">
                                {if !empty($suit['sellprice'])}{Currency_Tool::symbol()}{$suit['sellprice']}{/if}
                            </p>
                        </td>
                        <td>
                            <div class="price">
                                {if !empty($suit['ourprice'])}
                                {Currency_Tool::symbol()}<span class="n">{$suit['ourprice']}</span>
                                {else}
                                <span class="n">电询</span>
                                {/if}
                            </div>
                        </td>
                        <td>
                            {if $suit['price_status']==1}
                            {if !empty($suit['ourprice'])}
                            <a class="reserve-btn" href="javascript:;" data-suitid="{$suit['id']}">立即预订</a>
                            {else}
                            <a class="reserve-btn disabled" href="javascript:;">售罄</a>
                            {/if}
                            {elseif $suit['price_status']==3}
                            <a class="reserve-btn disabled" href="javascript:;">售罄</a>
                            {elseif $suit['price_status']==2}
                            <a class="reserve-btn disabled" href="javascript:;">售罄</a>
                            {/if}
                        </td>
                    </tr>
                    <tr class="unfold">
                        <td colspan="6">
                            <div class="detail-con">
                                <h3 class="title">{$suit['title']}</h3>
                                <ul>
                                    <li class="clearfix">
                                        <span class="label">有效期限：</span>
                                        {if $suit['effective_days']==0 }
                                        <div class="con">指定日期当天内有效</div>
                                        {else}
                                        <div class="con">游客指定入园日期{$suit['effective_days']}天内有效</div>
                                        {/if}
                                    </li>
                                    <li class="clearfix">
                                        <span class="label">取票方式：</span>
                                        <div class="con">{$suit['get_ticket_way']}</div>
                                    </li>
                                    <li class="clearfix">
                                        <span class="label">退改方式：</span>
                                        <div class="con">
                                            {if $suit['refund_restriction']==0}无条件退
                                            {elseif $suit['refund_restriction']==1}不可退改
                                            {elseif $suit['refund_restriction']==2}有条件退
                                            {/if}
                                        </div>
                                    </li>
                                    {if !empty($suit['suppliername'])}
                                    <li class="clearfix">
                                        <span class="label">供应商：</span>
                                        <div class="con">{$suit['suppliername']}</div>
                                    </li>
                                    {/if}
                                    <li class="clearfix">
                                        <span class="label">门票说明：</span>
                                        <div class="con">
                                            {$suit['description']}
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                    {/if}
                    {/loop}
                    {/if}
                    {/loop}
                    </tbody>
                </table>
            </div>

            <div class="clearfix">
                <!-- 左侧内容 -->
                <div class="content-detail-left">
                    <!-- 交通地图 -->
                    {if !empty($info['lng']) && !empty($info['lat'])}
                    <div class="content-detail-map" id="md-jtdt">
                        <h3 class="content-detail-title clearfix">交通地图</h3>
                        <div class="content clearfix">
                            <div class="left">
                                <div class="left-nav">
                                    <a class="on" href="javascript:;" data-c="车站,地铁">交通</a>
                                    <a href="javascript:;" data-c="饭店">美食</a>
                                </div>
                                <div class="left-con">
                                    <div class="left-item" id="result1">

                                    </div>
                                    <div class="left-item" id="result2">

                                    </div>
                                </div>
                            </div>
                            <div class="right" id="allmap"></div>
                        </div>
                        <script>
                            $(document).ready(function () {
                                // 交通地图
                                gbl_info_window_show = false;
                                var map = {
                                    init: function () {
                                        this._aclick();
                                        this._bmap();
                                    },
                                    _aclick: function () {
                                        $('.content-detail-map .left-nav a').click(function () {
                                            $(this).addClass('on').siblings().removeClass('on');
                                            $('.content-detail-map .left-item').eq($(this).index()).show().siblings().hide();
                                        })
                                    },
                                    _bmap: function () {
                                        var map = new BMap.Map("allmap");            // 创建Map实例
                                        map.addControl(new BMap.NavigationControl());
                                        map.enableScrollWheelZoom(false);
                                        // map.disableDragging();     //禁止拖拽
                                        map.disableScrollWheelZoom();//禁止缩放
                                        var hotel_point = new BMap.Point({$info['lng']}, {$info['lat']});
                                        map.centerAndZoom(hotel_point, 13);
                                        var marker = new BMap.Marker(hotel_point);        // 创建标注
                                        map.addOverlay(marker);

                                        var opts = {
                                            width: 200,
                                            height: 50,
                                            title: '{$info['title']}'
                                        }
                                        var infoWindow = new BMap.InfoWindow("{$info['address']}", opts);  // 创建信息窗口对象
                                        marker.addEventListener("click", function () {
                                                map.openInfoWindow(infoWindow, hotel_point);
                                            }
                                        );

                                        var current_address = '';

                                        var letters_arr = ['A', 'B', 'C', 'D', 'E', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
                                        $('.content-detail-map .left-nav a').click(function () {
                                            myKeys = $(this).attr('data-c');
                                            local = new BMap.LocalSearch(map, {
                                                renderOptions: {
                                                    map: map,
                                                    autoViewport: false,
                                                    selectFirstResult: false,
                                                    panel: "result" + ($(this).index() + 1)
                                                }
                                                ,
                                                onResultsHtmlSet: function () {

                                                    map.openInfoWindow(infoWindow, hotel_point);
                                                    $('.content-detail-map .left-item li').each(function () {
                                                        $(this).children('span').html(letters_arr[$(this).index()]);
                                                    });
                                                    $('.content-detail-map .left-item li').click(function () {
                                                        $(this).addClass('li-bg').siblings().removeClass('li-bg');
                                                    })

                                                    if (!gbl_info_window_show) {
                                                        map.openInfoWindow(infoWindow, hotel_point);
                                                        gbl_info_window_show = true;
                                                    }

                                                }
                                            });
                                            local.searchNearby(myKeys, current_address, 20000);
                                        });
                                        var myGeo = new BMap.Geocoder();
                                        myGeo.getLocation(hotel_point, function (result) {
                                            if (result) {
                                                current_address = result.address;
                                                $('.content-detail-map .left-nav a:first').trigger('click');

                                            }
                                        });

                                        map.addEventListener("tilesloaded", function () {
                                            $('.content-detail-map .left-item li').each(function () {
                                                $(this).children('span').html(letters_arr[$(this).index()]);
                                            });
                                            $('.content-detail-map .left-item li').click(function () {
                                                $(this).addClass('li-bg').siblings().removeClass('li-bg');
                                            })
                                        });
                                    }
                                }
                                map.init();
                            });
                        </script>
                    </div>
                    {/if}

                    {loop $spotcontent $s}
                    <div class="content-detail-edit" id="md-{$s['columnname']}">
                        <h3 class="content-detail-title clearfix">{$s['chinesename']}</h3>
                        <div class="content">
                            {Common::content_image_width($s['content'],833,0)}
                        </div>
                    </div>
                    {/loop}

                    {if Model_Sysconfig::get_configs(0,'cfg_comment_spot_lock',1)==1}
                    {include 'spot/comment'}
                    {/if}
                    <!-- 商品评论 -->
                    {include 'spot/ask'}

                    <!-- 我要咨询 -->
                </div>

                <!-- 右侧模块 -->
                <div class="content-detail-right h500">
                    {st:right action="get" typeid="$typeid" data="$templetdata" pagename="show"}
                </div>
            </div>

        </div>
    </div>
</div>
<div class="code-layer-container hide">
    <div class="code-layer-block more">
        <div class="code-layer-tit"><div class="tit">请使用手机扫码下单，更方便</div><i class="close-btn"></i></div>
        <div class="code-layer-content">
            <div class="code-box xcx-code">
                <img src="{$tpl}/cms5.0/images/pic/t-code.jpg" />
                <div class="tit">微信扫码</div>
            </div>
            <div class="or">或</div>
            <div class="code-box h5-code">
                <img src="{$tpl}/cms5.0/images/pic/t-img.jpg" />
                <div class="tit">微信或浏览器扫码</div>
            </div>
        </div>
    </div>
</div>
{request "pub/footer"}
{request "pub/flink"}
{include "member/login_order"}
<script>
    //分享
    window._bd_share_config = {
        "common": {
            "bdSnsKey": {},
            "bdText": "",
            "bdMini": "2",
            "bdMiniList": ['qzone', 'tsina', 'renren', 'tqf', 'tieba', 'bdhome', 'sqq', 'mail', 'copy', 'print', 'ibaidu', 'weixin'],
            "bdPic": "",
            "bdStyle": "0",
            "bdSize": "16"
        }, "share": {}
    };
    window._bd_share_config = {
        "common": {
            "bdSnsKey": {},
            "bdText": "",
            "bdMini": "2",
            "bdMiniList": ['qzone', 'tsina', 'renren', 'tqf', 'tieba', 'bdhome', 'sqq', 'mail', 'copy', 'print', 'ibaidu', 'weixin'],
            "bdPic": "",
            "bdStyle": "0",
            "bdSize": "16"
        },
        "share": {},
        "image": {"viewList": ["qzone", "tsina", "tqq", "renren", "weixin"], "viewText": "分享到：", "viewSize": "16"},
        "selectShare": {"bdContainerClass": null, "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren", "weixin"]}
    };
    with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = '/res/js/bdshare/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
</script>
<script>


    $(function () {
        $('.close-btn').click(function(){
            $(this).parent().parent().parent().addClass('hide');
        });
        //预订
        $(".reserve-btn").click(function () {
            if ($(this).hasClass('disabled')) {
                return;
            }
            var suitid = $(this).attr('data-suitid');
            if (!suitid || !is_login_order()) {
                return false;
            }
            var productid = "{$info['id']}";
            //验证套餐类型，获取移动端二维码
            $.ajax({
                type:'POST',
                url:SITEURL+'pub/ajax_scan_code_validate',
                data:{product_id:productid,suit_id:suitid,type_id:5},
                dataType:'json',
                success:function(data){
                    console.log(data);
                    if(data.status){
                        $('.code-layer-container').removeClass('hide');
                        if(data.code_img.xcx && data.code_img.web){
                            $('.xcx-code img').attr('src',data.code_img.xcx);
                            var h5_url = '/res/vendor/qrcode/make.php?param='+data.code_img.web;
                            $('.h5-code img').attr('src',h5_url);
                        }else{
                            var h5_url = '/res/vendor/qrcode/make.php?param='+data.code_img.web;
                            $('.xcx-code img').attr('src',h5_url);
                            $('.code-layer-block').removeClass('more');
                            $('.h5-code').hide();
                            $('.code-layer-content .or').hide();
                        }
                    }else{
                        var url = SITEURL + 'spot/book/?suitid=' + suitid + "&productid=" + productid;
                        window.location.href = url;
                    }
                }
            })
        })

        // 轮播
        var view = {
            init: function () {
                var viewSwiper = new Swiper('.view .swiper-container', {
                    onSlideChangeStart: function () {
                        updateNavPosition()
                    }
                })
                $('.view .arrow-left,.preview .arrow-left').on('click', function (e) {
                    e.preventDefault()
                    if (viewSwiper.activeIndex == 0) {
                        viewSwiper.swipeTo(viewSwiper.slides.length - 1, 500);
                        return
                    }
                    viewSwiper.swipePrev()
                })
                $('.view .arrow-right,.preview .arrow-right').on('click', function (e) {
                    e.preventDefault()
                    if (viewSwiper.activeIndex == viewSwiper.slides.length - 1) {
                        viewSwiper.swipeTo(0, 500);
                        return
                    }
                    viewSwiper.swipeNext()
                })
                var previewSwiper = new Swiper('.preview .swiper-container', {
                    visibilityFullFit: true,
                    slidesPerView: 'auto',
                    onlyExternal: true,
                    onSlideClick: function () {
                        viewSwiper.swipeTo(previewSwiper.clickedSlideIndex)
                    }
                })
                function updateNavPosition() {
                    $('.preview .active-nav').removeClass('active-nav')
                    var activeNav = $('.preview .swiper-slide').eq(viewSwiper.activeIndex).addClass('active-nav')
                    if (!activeNav.hasClass('swiper-slide-visible')) {
                        if (activeNav.index() > previewSwiper.activeIndex) {
                            var thumbsPerNav = Math.floor(previewSwiper.width / activeNav.width()) - 1
                            previewSwiper.swipeTo(activeNav.index() - thumbsPerNav)
                        } else {
                            previewSwiper.swipeTo(activeNav.index())
                        }
                    }
                }
            }
        }
        view.init();

        // 内容菜单
        var mainnav = {
            init: function () {
                var w = 0;
                var $wm1200 = $(".mainnav .wm-1200");
                var $con = $('.mainnav .con');
                var $a = $('.mainnav .con a');
                $a.each(function () {
                    w += $(this).outerWidth();
                })
                $con.width(w + $a.length * 13 + 50 + 'px');
                if ($con.width() >= 1200) {
                    $('.mainnav .mainnav-fixed').addClass('hidescroll');
                }
                this._scroll($wm1200);
                this._click($wm1200, $con);
                this._aclick($('a[data-href]'));
                this._wscroll($a);
            },
            _aclick: function ($a) {
                $a.click(function () {
                    var md = $(this).attr('data-href')
                    if ($('#' + md).length != 0) {
                        $("html, body").animate({
                            scrollTop: ($("#" + md + "").offset().top - 55)
                        }, 500);
                    }
                })
            },
            _scroll: function ($wm1200) {
                $wm1200.scroll(function () {
                    var scleft = $(this).scrollLeft()
                    if (scleft == 0) {
                        $('.mainnav .prev').addClass('op5');
                        $('.mainnav .next').removeClass('op5');
                    } else {
                        $('.mainnav .prev').removeClass('op5');
                        $('.mainnav .next').addClass('op5');
                    }
                })
            },
            _click: function ($wm1200, $con) {
                $('.mainnav .btn').click(function () {
                    if ($(this).hasClass('prev')) {
                        $wm1200.animate({
                            scrollLeft: 0
                        })
                    } else {
                        $wm1200.animate({
                            scrollLeft: $con.width() - 1150
                        })
                    }
                })
            },
            _wscroll: function ($a) {
                $(window).scroll(function () {
                    // 整栏浮动
                    if ($(this).scrollTop() > $('.mainnav').offset().top) {
                        $('.mainnav .mainnav-fixed').addClass('mainnav-fixed-y');
                    } else {
                        $('.mainnav .mainnav-fixed').removeClass('mainnav-fixed-y');
                    }

                    // 滚动期间导航自动响应颜色
                    var offsettop = [];
                    var wscrolltop = $(window).scrollTop() + 60;
                    $a.each(function (index) {
                        var datahref = $(this).attr('data-href');
                        console.log(datahref);
                        if ($('#' + datahref).length != 0) {
                            offsettop.push($('#' + datahref).offset().top);
                        }
                    });
                    offsettop.push(10000);
                    for (var i = 0; i < offsettop.length - 1; i++) {
                        if (wscrolltop > offsettop[i] && wscrolltop < offsettop[i + 1]) {
                            $a.eq(i).addClass('on').siblings().removeClass('on');
                            return false;
                        }
                    }

                })
            }
        }
        mainnav.init();

        // 预定
        $('.content-main-reserve .reserve-name').on('click', function () {
            var c = $(this).attr('name');
            var tr = $(this).parents('tr');
            var tbody = $('.content-main-reserve tbody');
            var v = tbody.find('#' + c);
            var v2 = $('.content-main-reserve .va-top');
            var l = tbody.find('[name=' + c + ']').length;
            for (var i = 0; i < v2.length; i++) {
                v2.eq(i).attr('rowspan', $('[name=' + v2.eq(i).attr('id') + ']').length);
            }
            tr.siblings('.on').next('.unfold').hide().end().removeClass('on');
            if (!tr.hasClass('on')) {
                tr.addClass('on').next('.unfold').show();
                v.attr('rowspan', l + 1);
            } else {
                tr.removeClass('on').next('.unfold').hide();
                v.attr('rowspan', l);
            }
        });
    })
</script>
</body>
</html>